<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="myTags" tagdir="/WEB-INF/tags/components" %>
<%@ tag language="java" pageEncoding="ISO-8859-1"%>
<%@ attribute name="comment" required="true" type="beans.Comment" rtexprvalue="true" %>
<%@ attribute name="post" type="beans.Post" rtexprvalue="true" %>

<!-- Author: Minh-Tuan Ta -->

<div class="comment">
	<myTags:SmallUserBlock user="${comment.user }"></myTags:SmallUserBlock>
	<div class="commentContent">${comment.content }</div>
	${comment.formattedDateCreatedString }
	<c:if test="${comment.userID == User.userID}">
		<form action="DeleteComment" method="post">
			<input type="hidden" name="commentID" value="${comment.contentID}" />
			<input type="submit" name="submit" value="Delete Comment" />
		</form>
	</c:if>
	<div class="ratings">
		<span class="helpful">${comment.numHelpful } <img src="images/icons/thumb-up.gif"/></span>
		<form action="Rate" method="post">
			<input type="hidden" name="contentID" value="${comment.contentID }" />
			<input type="submit" name="rateValue"  value="Helpful" />
		</form>
		<span class="notHelpful">${comment.numNotHelpful } <img src="images/icons/thumb-down.gif"/></span>
		<form action="Rate" method="post">
			<input type="hidden" name="contentID" value="${comment.contentID }" />
			<input type="submit" name="rateValue" value="Not Helpful">
		</form>
		Will you rate this post?<br />
		
	</div>
</div>